<?php
namespace app\index\controller;
use think\Controller;
use app\common\model\Wares;

class Product extends Controller
{
    public function index()
    {
    	$wares = new Wares();

    	$id = input("param.id");
    	
    	if($id!=""){
    		
    		$result = $wares->findData($id);
    		
    		if(!empty($result)){
    			
    			$result['images'] = explode('#',substr($result["banner"],1));
    			
    			return $this->fetch("",["title"=>"商品详情","wares"=>$result]);

    		}else{

    			$this->error("商品不存在");
    		}
    	}else{

    		$this->error("缺少商品ID");

    	}
    }
}
